<template>
  <div
    class="main_auxiliaryBlank"
    v-if="oItem"
    :style="{
      paddingTop: oItem.main.wrapperPT + 'px',
      paddingBottom: oItem.main.wrapperPB + 'px',
      paddingLeft: oItem.main.wrapperPLR + 'px',
      paddingRight: oItem.main.wrapperPLR + 'px',
    }"
  >
    <div
      class="content"
      :style="{
        backgroundColor: oItem.main.wrapperBgColor,
        backgroundImage: oItem.main.wrapperBgImg
          ? 'url(\'' + oItem.main.wrapperBgImg + '\')'
          : 'none',
        borderTopLeftRadius: oItem.main.wrapperBTR + 'px',
        borderTopRightRadius: oItem.main.wrapperBTR + 'px',
        borderBottomLeftRadius: oItem.main.wrapperBBR + 'px',
        borderBottomRightRadius: oItem.main.wrapperBBR + 'px',

        paddingTop: oItem.main.modulePT + 'px',
        paddingBottom: oItem.main.modulePB + 'px',
        paddingLeft: oItem.main.modulePLR + 'px',
        paddingRight: oItem.main.modulePLR + 'px',
      }"
    >
      <div class="blank" :style="{ 
        borderTopLeftRadius: oItem.main.moduleBTR + 'px',
        borderTopRightRadius: oItem.main.moduleBTR + 'px',
        borderBottomLeftRadius: oItem.main.moduleBBR + 'px',
        borderBottomRightRadius: oItem.main.moduleBBR + 'px',
        height: oItem.main.height + 'px',
        backgroundColor: oItem.main.moduleBgColor,
        backgroundImage: oItem.main.moduleBgImg
          ? 'url(\'' + oItem.main.moduleBgImg + '\')'
          : 'none',
       }"></div>
    </div>
  </div>
</template>

<script>
import Bus from "@/utils/bus";
import { mapState } from "vuex";
export default {
  name: "mainAuxiliaryBlank",
  data() {
    return {
      oItem: null,
      rightIndex: 0,
      catalogIndex: 0,
    };
  },
  props: ["item", "ename", "id"],
  components: {},
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.init();
    });
    const emitName = this.ename + this.id;
    Bus.$off(emitName);
    Bus.$on(emitName, (control) => {
      //console.log("auxiliaryBlankComponent被通知更新");
      this.oItem = JSON.parse(control);
    });
  },
  methods: {
    //页面初始化
    init() {
      this.oItem = null;
      this.oItem = JSON.parse(JSON.stringify(this.item));
    },
  },
  computed: mapState(["decorate"]),
  watch: {},
};
</script>

<style scoped lang="scss">
.main_auxiliaryBlank {
  width: 100%;
  box-sizing: border-box;
  .content {
    width: 100%;
    box-sizing: border-box;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: scroll;
    .blank {
      width: 100%;
      box-sizing: border-box;
      background-position: center center;
      background-repeat: no-repeat;
      background-size: 100% 100%;
      background-attachment: scroll;
    }
  }
}
</style>
